home *** CD-ROM | disk | FTP | other *** search
- Path: amaryllisp1.appsig.com!user
- From: larry_kearney@appsig.com (Lawrence Kearney)
- Newsgroups: comp.lang.c
- Subject: Re: Not used functions
- Date: Thu, 18 Jan 1996 07:19:10 -0700
- Organization: Applied Signal Technology
- Distribution: world
- Message-ID: <larry_kearney-1801960719100001@amaryllisp1.appsig.com>
- References: <8B8F2EE.108500D8CB.uuout@dkb.dk>
- NNTP-Posting-Host: amaryllisp1.appsig.com
-
- > Question:
- > Now, I have a lot of string definitions and a lot of functions that I do
- > not use anymore. Both strings and functions are not static-declared. I
- want to
- > delete these strings and functions. Does anyone know a program who can
- check if
- > these are used? Can PC-lint do it?
- >
- > Thanks
- >
- > Roland
- > ro@dkb.dk
- >
- > (If possible please mail me directly (as well as to this group), I
- > only have a lousy program to search through messages and cannot follow
- > branches in a message structure - if you a good program, please inform me)
-
- One way to do this is to simply comment out the code using the preprocessor pair
-
- #if 0
-
- ... code you want to remove ...
-
- #endif
-
- around the offending sections, recompile, and then link. If you remove
- code that is called elsewhere, the linker should bug you about unresolved
- references or something like that. Remove the #if around those pieces and
- try it again until your program links successfully. You can then delete
- the unused code from the source files permanently.
-
- --
- Larry Kearney | "You want fries with that?"
- Applied Signal Technology |
- larry_kearney@appsig.com |
-